import { Pipe, PipeTransform } from '@angular/core';
import { StorageService } from './sotrage/storage.service';
@Pipe({ name: 'getstatus' })

export class StatusPipe implements PipeTransform {
    transform(value: any , type:string): string {
        let map = {
            'PENDING': '等待支付',
            'COMPLETED': '交易成功',
			'FAILED': '交易关闭',
			'WAITING_CONVERSION':'等待换算'
            // CANCELED,
            // REFUNDED,
            // RECHARGE_WAITING,
            // RECHARGE_EXPIRED,
            // RECHARGE_FAILED,
            // RECHARGE_SUCCESS
        }
        return map[value];
    }
} 

@Pipe({ name: 'getstatus2' })

export class StatusPipe2 implements PipeTransform {
    transform(value: any , type:string): string {
        let map = {};
        if(value){
           map = JSON.parse(value);
        }
        let lang = {
            "zh":"zh_CN",
            "jp":"ja_JP",
            "en":"en_US",
        }
        return map[lang[type]];
    }
} 
